package com.naiterui.ehp.bs.ds.modules.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.ds.common.utils.PageVO;
import com.naiterui.ehp.bs.ds.common.vo.PageParamsVO;
import com.naiterui.ehp.bs.ds.modules.goods.vo.WarehouseManageVO;
import com.naiterui.ehp.bs.ds.modules.sys.entity.User;
import java.util.List;
import java.util.Set;

/**
 * 系统用户
 */
public interface IUserService extends IService<User> {

    PageVO<User> queryPage(PageParamsVO pageParamsVO, User user);

    /**
     * 查询用户的所有菜单ID
     */
    List<Long> queryAllMenuId(Long userId);

    /**
     * 修改用户
     */
    void update(User user) throws BusinessException;

    /**
     * 修改密码
     *
     * @param user        用户ID
     * @param password    原密码
     * @param newPassword 新密码
     */
    void updatePassword(User user, String password, String newPassword) throws BusinessException;

    Set<String> getPermission(Long userId);

    String getUserNameByWarehouseId(Long warehouseId);

    /**
     * 保存更新管理用户密码
     */
    void updateManage(Long warehouseId, WarehouseManageVO warehouseManage) throws BusinessException;

    void updateStatus(Long warehouseId, Integer status);

    User loadUserByUsername(String username) throws BusinessException;
}
